<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box1{width: 200px;height: 200px;background-color: red;
        margin-bottom: 30px;}
        #box2{width: 200px;height: 200px;background-color: blue;
        margin-top: 50px;
        margin-bottom: 70px;}  /* 叠加问题，保留数值较大的一边 */
        /* 解决方案：只给一个元素添加间距a */

    #box3{width: 200px;height: 200px; background-color: blue;border: 5px black solid;}
    #box4{width: 100px;height: 100px; background-color: red;
    margin-top: 50px;margin-left: 50px;}
/*  */

    </style>
</head>
<body>
    <div id="box1">这是第一个盒子</div>
    <div id="box2">这是第二个盒子</div>
    <div id="box3"> 
        <div id="box4">这是嵌套的里边的盒子</div>
    </div>
   

</body>
</html>